package com.syan.learn.optimization.ch02.singleton;


public class LazySingleton {

	public static LazySingleton instanse = null;

	private LazySingleton() {
		System.out.println("constructor...");
	}

	public synchronized static LazySingleton getInstanse() {
		if (instanse == null) {
			instanse = new LazySingleton();
		}
		return instanse;
	}

	public void doSomething() {
		System.out.println("do someting...");
	}

	public static void main(String[] args) {
		LazySingleton.getInstanse().doSomething();
	}

}
